package game;

// Team类
import java.util.ArrayList;
import java.util.List;

public class Team {
    private List<Role> members = new ArrayList<>();

    public void addMember(Role role) {
        if (members.size() < 6) {
            members.add(role);
        } else {
            System.out.println("队伍已满，无法添加更多成员");
        }
    }

    public int attackSum() {
        int totalDamage = 0;
        for (Role member : members) {
            totalDamage += member.attack();
        }
        return totalDamage;
    }
}
